/*
 * @Author: fengshan0525 2735332396@qq.com
 * @Date: 2023-03-17 20:42:43
 * @LastEditors: fengshan@0525 3183359488@qq.com
 * @LastEditTime: 2023-05-23 11:16:03
 * @FilePath: \nest-template\src\menu\menu.module.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import {
  MiddlewareConsumer,
  Module,
  NestModule,
  RequestMethod,
} from '@nestjs/common';
import { MenuService } from './menu.service';
import { MenuController } from './menu.controller';
import { RolesModule } from 'src/roles/roles.module';
import { JwtModule } from '@nestjs/jwt';
import { ParseUserRoles } from 'src/middlware/userRoles';

@Module({
  imports: [RolesModule, JwtModule],
  controllers: [MenuController],
  providers: [MenuService],
})
export class MenuModule implements NestModule {
  configure(consumer: MiddlewareConsumer) {
    consumer.apply(ParseUserRoles).forRoutes(MenuController);
  }
}
